home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / compress / jrbzoo21.zoo / makefile < prev    next >
Makefile  |  1991-09-25  |  11KB  |  277 lines

  1. # derived from: @(#) makefile 2.2 88/01/27 19:37:59 
  2. # $Id: makefile,v 1.25 1991/08/12 17:08:37 bammi Exp $
  3. # Make Zoo
  4. #
  5. #The contents of this makefile are hereby released to the public domain.
  6. #                                  -- Rahul Dhesi 1991/07/05
  7. #
  8. # This makefile expects two macro names, `CFLAGS' and `EXTRA', to hold
  9. # all the switches to be supplied to the C compiler.  It also expects
  10. # a macro `LDFLAGS' to hold the switch for the loader when invoked.
  11. # The macro "MODEL" holds switches needed for both compile and link, 
  12. # such as "memory model" for Intel and Z8000 processors. OPTIM is the 
  13. # optimize option and may be set on the make command line to -O2 or 
  14. # whatever your compiler thinks is nice.
  15. #
  16. # To run lint, select an appropriate lint_* target (e.g. "make lint_sysv").
  17.  
  18.  
  19. MAKE = make          # needed for some systems e.g. older BSD
  20.  
  21. CC = cc
  22. CFLAGS =
  23. MODEL =
  24. EXTRA = -DBIG_MEM -DNDEBUG
  25. LINTFLAGS = -DLINT
  26. OPTIM = -O
  27. DESTDIR = /usr/local/bin
  28.  
  29. #List of all object files created for Zoo
  30. ZOOOBJS = addbfcrc.o addfname.o basename.o comment.o crcdefs.o \
  31.         getfile.o lzc.o lzd.o machine.o makelist.o misc.o misc2.o \
  32.         nextfile.o needed.o options.o parse.o portable.o prterror.o \
  33.         version.o zoo.o zooadd.o zooadd2.o zoodel.o zooext.o zoofilt.o \
  34.         zoolist.o zoopack.o io.o lzh.o maketbl.o maketree.o huf.o \
  35.         encode.o decode.o
  36.  
  37. FIZOBJS = fiz.o addbfcrc.o portable.o crcdefs.o
  38.  
  39. .c.o :
  40.     $(CC) $(CFLAGS) $(MODEL) $(EXTRA) $*.c
  41.  
  42. all : 
  43.     @echo 'There is no default.  Please specify an appropriate target from'
  44.     @echo 'the makefile, or type "make help" for more information'
  45.  
  46. help :
  47.     @echo "Possible targets are as follows.  Please examine the makefile"
  48.     @echo "for more information."
  49.     @echo ' '
  50.     @echo "generic:      generic **IX environment, minimal functionlity"
  51.     @echo "bsd:          4.3BSD or reasonable equivalent"
  52.     @echo "bsdansi:      4.3BSD with ANSI C"
  53.     @echo "ultrix:       ULTRIX 4.1"
  54.     @echo "convex:       Convex C200 series"
  55.     @echo "sysv:         System V Release 2 or 3; or SCO Xenix"
  56.     @echo "scodos:       Cross-compiler under SCO Xenix/UNIX for MS-DOS"
  57.     @echo "xenix286:     Older Xenix/286 (not tested)"
  58.     @echo "xenix68k:     Xenix/68000 (not tested)"
  59.     @echo ' '
  60.     @echo "install:      Move zoo to $(DESTDIR)/tzoo (alpha test)"
  61.     @echo "inst_beta:    Move zoo to $(DESTDIR)/bzoo (beta test)"
  62.     @echo "inst_prod:    Move zoo to $(DESTDIR)/zoo  (production)"
  63.     @echo ' '
  64.     @echo "lint_sysv:    Run lint for System V"
  65.     @echo "lint_bsd:     Run lint for 4.3BSD"
  66.     @echo "lint_generic: Run lint for generic **IX"
  67.     @echo "lint_turboc:  Run lint under **IX for checking Turbo C/MSDOS code"
  68.  
  69. # install alpha zoo as "tzoo"
  70. install:
  71.     mv zoo $(DESTDIR)/tzoo
  72.  
  73. # install beta zoo as "bzoo"
  74. inst_beta:
  75.     mv zoo $(DESTDIR)/bzoo
  76.  
  77. # install production zoo as "zoo"
  78. inst_prod:
  79.     mv zoo $(DESTDIR)/zoo
  80.  
  81. # executable targets
  82. TARGETS = zoo fiz
  83.  
  84. #######################################################################
  85. # SYSTEM-SPECIFIC TARGETS
  86. #######################################################################
  87.  
  88. # A generic system -- may have less than full functionality.
  89. # Compile with -g, since debugging will probably be needed.
  90. generic:
  91.     $(MAKE) CFLAGS="-c -g -DGENERIC" $(TARGETS)
  92.  
  93. # Reasonably generic BSD 4.3
  94. bsd:
  95.     $(MAKE) CFLAGS="-c $(OPTIM) -DBSD4_3" $(TARGETS)
  96.  
  97. # Reasonably generic BSD 4.3 with -g
  98. gbsd:
  99.     $(MAKE) CFLAGS="-c -g -DBSD4_3" LDFLAGS="-g" $(TARGETS)
  100.  
  101. # Reasonably generic BSD 4.3 with -pg
  102. bsdg:
  103.     $(MAKE) CFLAGS="-c -O -pg -DBSD4_3" LDFLAGS="-pg" $(TARGETS)
  104.  
  105. # ULTRIX 4.1
  106. ultrix:
  107.     $(MAKE) CFLAGS="-c $(OPTIM) -DULTRIX" $(TARGETS)
  108.  
  109. # BSD with ANSI C - works on MIPS and Ultrix/RISC compilers
  110. bsdansi:
  111.     $(MAKE) CFLAGS="-c $(OPTIM) -DBSD4_3 -DANSI_HDRS" $(TARGETS)
  112.  
  113. # Convex C200 series
  114. convex:
  115.     $(MAKE) CFLAGS="-c $(OPTIM) -DBSD4_3 -DANSI_HDRS" $(TARGETS)
  116.  
  117. # SysV.2, V.3, SCO Xenix
  118. sysv:
  119.     $(MAKE) CFLAGS="-c $(OPTIM) -DSYS_V" $(TARGETS)
  120.  
  121. hp-snake:
  122.     $(MAKE) CFLAGS="-c -Aa -D_HPUX_SOURCE $(OPTIM) +Obb1000 -DSYS_V -DANSI_HDRS" $(TARGETS)
  123.  
  124. # DOS version cross compiled from SCO Xenix/UNIX
  125. scodos:
  126.     $(MAKE) CFLAGS="-c $(OPTIM) -DTURBOC -DANSI_HDRS -DBIG_MEM" \
  127.         EXTRA="-dos -Ml" LDFLAGS="-o zoo.exe" $(TARGETS)
  128.  
  129. # Tested for zoo 2.01 on: Xenix 3.4 on Greg Laskin's Intel 310/286;
  130. # SCO Xenix 2.2 on Robert Cliff's AT.
  131. # `-Ml' for large memory model, `-M2' to generate code for 80286 cpu,
  132. # `-F xxxx' for xxxx (hex) bytes of stack space.
  133. xenix286:
  134.     @echo "Warning: xenix286 is not fully functional"
  135.     $(MAKE) CFLAGS="-c $(OPTIM) -DSYS_V" \
  136.         MODEL="-Ml -M2 -Md" \
  137.         LDFLAGS="-s -n -Md -Mt500 -F 5000" $(TARGETS)
  138.  
  139. # Radio Shack Model 16 with Xenix/68000 3.01.01. "-DM_VOID" tells not 
  140. # to try to do a typedef of `void'. "-Dvoid=int" because compiler doesn't 
  141. # know about `void'.  `-s -n' strips and makes it shareable.  Used to work
  142. # with zoo 2.01; not tested with 2.1.
  143. xenix68k:
  144.     $(MAKE) CFLAGS="-c $(OPTIM) -DSYS_V -DM_VOID -Dvoid=int" \
  145.         LDFLAGS="-s -n" $(TARGETS)
  146.  
  147. # tos
  148. tos:
  149.     $(MAKE) CC=cgcc CFLAGS="-c -Wstrict-prototypes -W $(OPTIM) -DTOS" $(TARGETS)
  150.  
  151. #######################################################################
  152. # CLEANUP TARGETS
  153. #######################################################################
  154.  
  155. # standard clean -- remove all transient files
  156. clean :
  157.     rm -f core a.out $(ZOOOBJS) $(FIZOBJS)
  158.  
  159. # object clean only -- just remove object files
  160. objclean:
  161.     rm -f *.o
  162.  
  163. #######################################################################
  164. # BINARY TARGETS
  165. #######################################################################
  166.  
  167. zoo: $(ZOOOBJS)
  168.     $(CC) -o zoo $(MODEL) $(LDFLAGS) $(ZOOOBJS)
  169.  
  170. fiz: $(FIZOBJS)
  171.     $(CC) -o fiz $(MODEL) $(LDFLAGS) $(FIZOBJS)
  172.  
  173. #######################################################################
  174. # SELECTED TARGETS FOR LINT
  175. #######################################################################
  176.  
  177. # generic system V
  178. lint_sysv:
  179.     echo $(ZOOOBJS) | sed -e 's/\.o/.c/g' | \
  180.     xargs lint -DSYS_V $(EXTRA) $(LINTFLAGS) | \
  181.     grep -v 'possible pointer alignment problem'
  182.  
  183. # generic BSD
  184. lint_bsd:
  185.     echo $(ZOOOBJS) | sed -e 's/\.o/.c/g' | \
  186.     xargs lint -DBSD4_3 $(EXTRA) $(LINTFLAGS) | \
  187.     grep -v 'possible pointer alignment problem'
  188.  
  189. # generic **IX
  190. lint_generic:
  191.     echo $(ZOOOBJS) | sed -e 's/\.o/.c/g' | \
  192.     xargs lint -DGENERIC $(EXTRA) $(LINTFLAGS) | \
  193.     grep -v 'possible pointer alignment problem'
  194.  
  195. # Cross-lint for checking Turbo C code under **IX.  For checking only;
  196. # compilation requires separate makefile called "makefile.tcc"
  197. lint_turboc:
  198.     echo $(ZOOOBJS) turboc.c | sed -e 's/\.o/.c/g' | \
  199.     xargs lint -DTURBOC -DCROSS_LINT $(EXTRA) $(LINTFLAGS)
  200.  
  201. #######################################################################
  202. # DEPENDENCIES
  203. #######################################################################
  204. # DO NOT DELETE THIS LINE -- it marks the beginning of this dependency list
  205.  
  206. addbfcrc.o: options.h
  207. addfname.o: /usr/include/stdio.h options.h various.h zoo.h zoofns.h zooio.h
  208. addfname.o: zoomem.h
  209. basename.o: /usr/include/stdio.h assert.h debug.h options.h parse.h various.h
  210. basename.o: zoo.h zoofns.h zooio.h
  211. bsd.o: /usr/include/sys/stat.h /usr/include/sys/time.h
  212. bsd.o: /usr/include/sys/types.h nixmode.i nixtime.i
  213. comment.o: /usr/include/signal.h /usr/include/stdio.h
  214. comment.o: /usr/include/sys/signal.h errors.i options.h portable.h various.h
  215. comment.o: zoo.h zoofns.h zooio.h
  216. crcdefs.o: options.h
  217. decode.o: /usr/include/stdio.h ar.h lzh.h options.h zoo.h
  218. encode.o: /usr/include/assert.h /usr/include/stdio.h ar.h errors.i lzh.h
  219. encode.o: options.h zoo.h
  220. fiz.o: /usr/include/stdio.h options.h portable.h various.h zoo.h zoofns.h
  221. fiz.o: zooio.h
  222. generic.o: /usr/include/sys/stat.h /usr/include/sys/types.h
  223. generic.o: /usr/include/time.h nixmode.i nixtime.i
  224. getfile.o: /usr/include/stdio.h options.h various.h zoo.h zoofns.h zooio.h
  225. getfile.o: zoomem.h
  226. huf.o: /usr/include/stdio.h ar.h errors.i lzh.h options.h zoo.h
  227. io.o: /usr/include/stdio.h ar.h errors.i lzh.h options.h portable.h zoo.h
  228. io.o: zooio.h
  229. lzc.o: /usr/include/stdio.h assert.h debug.h lzconst.h options.h various.h
  230. lzc.o: zoo.h zoofns.h zooio.h zoomem.h
  231. lzd.o: /usr/include/stdio.h assert.h debug.h lzconst.h options.h various.h
  232. lzd.o: zoo.h zoofns.h zooio.h zoomem.h
  233. lzh.o: /usr/include/stdio.h ar.h errors.i options.h zoo.h
  234. machine.o: /usr/in